package com.develop.skwen.basemodule.list;

import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import static android.view.View.NO_ID;

/**
 * Created by skwen
 * on 18-5-30
 */

public abstract class BaseHolder<D> extends RecyclerView.ViewHolder {



    public BaseHolder(View itemView) {
        super(itemView);
    }


    public abstract void bind(@NonNull D item);


    protected <T extends View> T findViewById(@IdRes int ids){
        if (ids == NO_ID)
            return null;
        return itemView.findViewById(ids);
    }


}
